<?php 
/**
 * Joomla! 1.5 component ArticleCashRewards
 *
 * @version $Id: default.php 2009-05-10 01:47:01 svn $
 * @author Maverick
 * @package Joomla
 * @subpackage components.views.tmpl
 * @link http://joomladev.boddunan.com
 * @license GNU/GPL
 *
 * Review and approve the articles and assign points and cash rewards.
 * Users can see their articles and the points/cash rewards assigned in the front-end module.
 */

// no direct access
defined('_JEXEC') or die('Restricted access');
if ( $this->rows ) {
?>
<form action="index.php?option=com_articlecashrewards" method="post" name="adminForm">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
  	<td class="componentheading<?php echo $this->params->get( 'pageclass_sfx' ) ?>" nowrap="nowrap">
  		<?php echo JText::_('VIEW_TOP_EARNERS'); ?>
  	</td>
  </tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
	<thead>
		<tr>
			<?php if ( $this->params->get('showleaderboard') ) { ?>
			<th class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" width="2%"><div align="center">#</div></th>
			<?php } ?>
			
			<th class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" width="40%"><div align="left"><?php echo JText::_('LABEL_USERNAME'); ?></div></th>
			
            <?php if($this->acr_config[CONFIG_ENABLE_POINTS] == '1'){ ?>
			<th class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" width="5%"><div align="left"><?php echo JText::_('LABEL_POINTS'); ?></div></th>
			<?php } ?>
			
			<th class="sectiontableheader<?php echo $this->params->get( 'pageclass_sfx' ); ?>" width="5%"><div align="left"><?php echo JText::_('LABEL_CASH'); ?></div></th>
		</tr>
	</thead>
	<tbody>
<?php
	$i = 0;
	$k = 0;
	$user =& JFactory::getUser();
	foreach ($this->rows as $row) {
		
		$href = '';
?>
		<tr>
			<?php if ( $this->params->get('showleaderboard') ) { ?>
			<td class="sectiontableentry<?php echo $k; ?>" width="10%"><div align="center"><?php echo $this->pagination->getRowOffset( $i); ?></div></td>
			<?php } ?>
			<td align="left">
				<a href="<?php echo $href; ?>">
					<?php echo $row->username; ?>
				</a>
			</td>
            <?php if($this->acr_config[CONFIG_ENABLE_POINTS] == '1'){ ?>
			<td align="left">
				<?php echo $row->points; ?>
			</td>
			<?php } ?>
			<td align="left">
				<?php echo $row->cash; ?>
			</td>
		</tr>
<?php
		$i++;
		$k = 1 - $k;
 	 }
?>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="9">
			<?php
				echo $this->pagination->getPagesLinks();
				echo $this->pagination->getPagesCounter();
			?>
			</td>
		</tr>
        <tr>
            <td align="center" colspan="9" nowrap="nowrap">
                <!--
                Please do not remove this notice and help us by giving us the
                credits for hundreds of our work in producing this product.
                -->
                <div style="font-size: 9px;;">
                Article Cash Rewards powered by <a href="http://www.boddunan.com">boddunan.com</a>
                </div>
            </td>
        </tr>
	</tfoot>
</table>
<input type="hidden" name="option" value="com_articlecashrewards" />
<input type="hidden" name="controller" value="topearners" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
} 
?>